﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BounceHelp : MonoBehaviour
{
    public float timeStamp;
    public float timeInterval = 5f;

    public GameObject level1act;

    public float minX = -6.8f;
    public float maxX = -5f;
    public float minY;
    public float maxY;

    private void Start()
    {
        timeStamp = Time.time;
        minX = -6.8f;
        maxX = -5f;
    }

    void Update()
    {
        if (Time.time >= timeStamp + timeInterval)
        {
            timeStamp = Time.time;
            float x = Random.Range(minX, maxX);
            float y = Random.Range(minY, maxY);
            GameObject.Instantiate(level1act, new Vector3(x,y,0f), Quaternion.Euler(Vector3.right));
        }
    }
}
